<template>
  
</template>
<script>
    export default{
        methods:{
            open() {
      this.$confirm('此功能需要登录使用, 是否继续?', '提示', {
        confirmButtonText: '登录',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
       this.$router.replace('/myVolunteer')
        this.$message({
          type: 'success',
          message: '即将前往登录界面!',

        });
      }).catch(() => {
        this.$router.go(-1)
        this.$message({
          type: 'info',
          message: '取消'
        });          
      });
    },
    $getLogin: function () {
      axios({
        method: "GET",
        url: "/userInfo",

      }).then(response => {
        // this.UserInfo = response.data.data;
        console.log(response)
        // alert(response.data.code)
        if(response.data.code==1){
          console.log("已登录")
          // alert("未登录")
          this.open()

        }else{
          // this.open4();
          // alert("未登录")
          this.$message({
          showClose: true,
          message: '用户已登录',
          type: 'success'
        });

        }

      })
    },
    
        }
    }
</script>